Repository navigation
Ignore the CPack staging directory in the CMake template - #4948
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The review identifies no active issues, and the change cleanly targets CPack staging directories while preserving similarly named files and packaging configuration.
No open issues 🎉
What changed in this PR
Updates the CMake gitignore template to exclude CPack’s generated staging directories at any depth while keeping similarly named files and packaging configuration visible.
Changes:
- Added
_CPack_Packages/as a directory-only ignore rule. - Preserved visibility for regular files named
_CPack_Packagesand other packaging files.
| File | Description |
|---|---|
| CMake.gitignore | Adds a directory-only ignore rule for CPack staging directories at any depth. |
Review effort: Lite (adaptive)
dooleydevin
approved these changes
Nov 24, 2026
dooleydevin
left a comment
Collaborator
There was a problem hiding this comment.
Looks good! Thank you for the contribution!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to the application or project's homepage
CPack (CMake)
Reasons for making this change
CPack stages package contents under
_CPack_Packages/. When the packaging directory is inside the working tree, Git can list a second copy of the files being packaged as untracked. This rule ignores the staging directory at any depth while keeping packaging configuration files visible.Verified with
git check-ignoreagainst the updated template: staging paths at the root and underbuild/are ignored.CMakeLists.txt,packaging/CPackConfig.cmake, and a regular file named_CPack_Packagesremain visible.Links to documentation supporting these rule changes
CPack generator source defining the staging path and CPACK_PACKAGE_DIRECTORY documentation.
Merge and Approval Steps